package main;

import java.util.ArrayList;

import emergency.Emergency;

import movement.Location;

import hospital.Hospital;
import unit.Unit;

public class FacadeUnit extends Facade {
	
	public FacadeUnit(World world) {
		super(world);
	}

	public void assignHospital(Unit u, Hospital h){
		u.assignHospital(h);
	}
	
	public void breakDown(Unit u) {
		u.brokeDown();
	}
	
	public void finishEmergency(Unit u) throws Exception{
		u.endEmergency();
	}
	
	protected ArrayList<Unit> getAllAvailableUnits(Emergency teBehandelenEmergency) {
		return teBehandelenEmergency.filterUnits(getDispatchCenter().getGarage());
	}

	public ArrayList<Hospital> getHospitals() {
		return super.getDispatchCenter().getHospitals();
	}
	
	protected ArrayList<Hospital> getHospitals(Location location) {
		return super.getDispatchCenter().getHospitals(location);
	}

	public void repair(Unit u) {
		u.repair();
	}
	

}
